/**
 * @(#)LoadActivity.java
 * 
 * @Version: 1
 * @JDK: jdk 1.6.0.XXX
 * @Module: MBA
 */
/*- 				History
 **********************************************
 *  ID      DATE           PERSON       REASON
 *  1     2013-03-04     Yongkai.Yu    Created
 **********************************************
 */


package com.mba.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;
import android.widget.Toast;

import com.mba.base.BaseActivity;
import com.mba.bean.UserInfo;

/**
 * 启动加载
 * 
 */
public class LoadActivity extends BaseActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        NOTITLE();
        FULLSCREEN();
        setContentView(R.layout.load);
        ImageView loadImage = (ImageView) findViewById(R.id.logo);
        // 透明度渐变动画  不透明
        AlphaAnimation animation = new AlphaAnimation(1.0f, 1.0f);
        // 动画持续时间
        animation.setDuration(1 * 3500);
        // 动画绑定到ImageView组件上执行
        loadImage.setAnimation(animation);
        animation.setAnimationListener(new AnimationListener() {
            /**
             * 动画开始时触发
             */
            @Override
            public void onAnimationStart(Animation animation) {
            	//加载欢迎语
            	/*
                Toast.makeText(
                        LoadActivity.this,
                        LoadActivity.this.getResources().getText(
                                R.string.load_top), Toast.LENGTH_SHORT).show();
                 */
                init();

            }
            /**
             * 动画结束的时候执行
             */
            @Override
            public void onAnimationEnd(Animation animation) {
                // 动画执行完毕，就跳转
                Intent intent = new Intent(LoadActivity.this,
                		MainTabActivity.class);
                //MainActivity.class);
                startActivity(intent);
                finish();
            }

            /**
             * 重复执行触发
             */
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            
        });
    }

    /**
     * 初始化
     */
    public void init() {
        
       
    }

    /**
     * 保存当前用户数据
     *
     */
    public static class UserSession {
        public static UserInfo nowUser;
    }
}
